<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
        <title>Vue-FPS</title>
        <!--引入第三方的jquery脚本库-->
        <script include="vue,antd,v-contextmenu" exclude="plugin" src="./static/libs/include-mapboxgl-local.js"></script>
        <style type="text/css">
            #app {
                margin: 0 0;
                width: 100%;
                height: 100vh;
            }
            #map {
                height: 100vh;
                width: 100%;
            }
        </style>
    </head>

    <body>
        <div id="app">
            <mapgis-web-map id="map" :map-style="mapStyle" :zoom="mapZoom" :center="outerCenter" :crs="mapCrs" v-on:load="handleMapLoad">
                <mapgis-arcgis-map-layer
                    layer-id="ArcGIS地图图层"
                    base-url="http://map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer">
                </mapgis-arcgis-map-layer>
                <mapgis-arcgis-tile-layer 
                  layer-id="ArcGIS瓦片图层" 
                  base-url="http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineCommunity/MapServer" >
                </mapgis-arcgis-map-layer>
                <mapgis-document>
                </mapgis-document>
            </mapgis-web-map>
        </div>
        <script>
            new Vue({
                el: '#app',
                data() {
                    return {
                        mapStyle: {
                            //设置版本号，一定要设置
                            version: 8,
                            //添加来源
                            sources: {},
                            //设置加载并显示来源的图层信息
                            layers: []
                        }, // 地图样式
                        mapZoom: 3, // 地图初始化级数
                        outerCenter: [116.39, 40.2], // 地图显示中心
                        mapCrs: 'EPSG:3857'
                    };
                },
                methods: {
                    handleMapLoad(payload) {
                        this.map = payload.map;
                    }
                }
            });
        </script>
    </body>
</html>
